{% extends "base.html" %}

{% block class %}profile{% endblock %}

{% block main %}
<h3>Changing Profile</h3>
<dl>
    {% if form.has_errors %}
    <dt>Please correct the following error{{ form.errors|pluralize }}:</dt>
    {% endif %}
    
    <form enctype="multipart/form-data" action='.' method='post'>
        <p><label for="id_user">User:</label>
        <select id="id_user" name="user">
            <option value="{{ user.id }}" selected="selected">{{ user.username }}</option>
        </select>        
        {% if form.user.errors %}*** {{ form.user.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_occupation">Occupation:</label> {{ form.occupation }}
        {% if form.occupation.errors %}*** {{ form.occupation.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_email">Email:</label> {{ form.email }}
        {% if form.email.errors %}*** {{ form.email.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_avatar">Avatar:</label> {{ form.avatar }}{{ form.avatar_file }}
        {% if form.avatar.errors %}*** {{ form.avatar.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_gender">Gender:</label> {{ form.gender }}
        {% if form.gender.errors %}*** {{ form.gender.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_cellphone">Cellphone:</label> {{ form.cellphone }}
        {% if form.cellphone.errors %}*** {{ form.cellphone.errors|join:", " }}{% endif %}</p>
        <p><label for="id_blog">Blog:</label> {{ form.blog }}
        {% if form.blog.errors %}*** {{ form.blog.errors|join:", " }}{% endif %}</p>
        <p><label for="id_room">Room:</label> {{ form.room }}
        {% if form.room.errors %}*** {{ form.room.errors|join:", " }}{% endif %}</p>
        <p><label for="id_birthday">Birthday:</label> {{ form.birthday }}
        {% if form.birthday.errors %}*** {{ form.birthday.errors|join:", " }}{% endif %}</p>
        <p><label for="id_birthplace">Birthplace:</label> {{ form.birthplace }}
        {% if form.birthplace.errors %}*** {{ form.birthplace.errors|join:", " }}{% endif %}</p>        
        <p><label for="id_intro">Intro:</label> {{ form.intro }}
        {% if form.intro.errors %}*** {{ form.intro.errors|join:", " }}{% endif %}</p>
        <input type="submit" />
    </form>
    <!--  
    This is a lifesaver when debugging!
    <p>{{ form.error_dict }}</p>
    -->
</dl>
{% endblock %}
